<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>医疗管家</title>
    <meta name="description" content="医疗管家">
    <meta name="keywords" content="医疗管家">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <!-- 引入组件库 -->
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script src="../js/vue.js"></script>
    <script src="../plugins/elementui/index.js"></script>
    <script src="../js/axios-0.18.0.js"></script>
    
</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>会员管理<small>数据分析</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>会员管理</el-breadcrumb-item>
            <el-breadcrumb-item>数据分析</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="app-container">
        <div class="box">
			<el-button type="primary" class="butT" @click="list()">性别比例</el-button>
			 <el-button type="primary" class="butT" @click="member()">会员具体数据</el-button>
            <div id="main" style="height: 668px;">
				
			</div>
        </div>
    </div>
</div>
</body>
<script src="../js/echarts.js""></script>
<script>
    
    var vue = new Vue({
        el: '#app',
        data:{
            setmealdata:[]
        },
        //加载页面即执行的函数
        created() {
           this.list();
        },
        methods: {
            list(){
                axios.get("http://localhost:9002/member/sex").then(response=>{
                    this.showPie(response.data.data)
                });
            },
			
			member(){
				location.href="membernum.html"
			},
            showPie(showdata){
                let main = echarts.init(document.getElementById("main"));
                // 指定图表的配置项和数据
                let option = {
                    title: {
                        text: '会员男女比例',
                        subtext: '会员男女比例',
                        left: 'center',
                    },
                    tooltip: {
                        trigger: 'item'
                    },
                    legend: {
                        orient: 'vertical',
                        left: 'right'
                    },
                    series: [{
                        name: '性别',
                        type: 'pie',
                        radius: '50%',
                        data: showdata,
                        emphasis: {
                            itemStyle: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }]
                };
                main.setOption(option);
            }
        }
    })
</script>
</html>